(function($ir){
	$ir.Util || ($ir.Util = {});
	
	function evaluate(word, config){
		var conf 		= config 			|| {};
		var l 			= conf.length 		|| 8;    			//默认判断长度8
		var cont 		= conf.count 		|| 2;  				//默认复杂度2种
		var key 		= conf.eye 			|| false; 			//默认大小写不敏感
		var msgLength 	= conf.msgLength 	|| "密码过短!";		//默认密码过短提示
		var msgCount 	= conf.msgCount 	|| "种类太少!";		//默认种类不够提示
		var msg 		= conf.fun 			|| _msg;			//默认消息提示空函数
		
		function _msg(msg){
			//console.log(msg);
		}
				
		if(word.length < l){
			msg(msgLength);
			return false;
		}else{
			var check = 0;
			if(key){
				check = word.match(/[a-z](?![^a-z]*[a-z])|[A-Z](?![^A-Z]*[A-Z])|\d(?![^\d]*\d)|[^a-zA-Z\d](?![a-zA-Z\d]*[^a-zA-Z\d])/g).length;
			}else{
				check = word.match(/[a-zA-Z](?![^a-zA-Z]*[a-zA-Z])|\d(?![^\d]*\d)|[^a-zA-Z\d](?![a-zA-Z\d]*[^a-zA-Z\d])/g).length;
			}
			if(check < cont){
				msg(msgCount);
				return false;
			}
		}
		return true;
	}
	
	function isNull(element){
		if(arguments.length > 1){
			for(var elem in arguments){
				elem = $ir(arguments[elem]);
				if(chackNull(elem.value) == true){
					return true;
				}
			}
			return false;
		}

		element = $ir(element);
		return chackNull(element.value);
		
		function chackNull(value){
			if (value == null || value.trim == "" || typeof value == "undefined" || value == "") {
				return true;
			} else {
				return false;
			}
		}
	}
	
	$ir.extend($ir.Util, {
		evaluate : 	  evaluate,
		isNull   :    isNull
	});
})($ir);
